import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace MakeupServiceOrderApi {
  /** 化妆服务订单信息 */
  export interface MakeupServiceOrder {
    id: number; // 
    orderId?: string; // 订单号
    artistCode?: string; // 化妆师编码
    customerId?: string; // 客户ID
    serviceTime?: string | Dayjs; // 服务时间
    serviceAddress: string; // 服务地址
    serviceAmount: number; // 服务金额
    paidAmount: number; // 已支付金额
    rating: number; // 评分
    remark: string; // 备注
    status: string; // 订单状态
  }
}

/** 查询化妆服务订单分页 */
export function getMakeupServiceOrderPage(params: PageParam) {
  return requestClient.get<PageResult<MakeupServiceOrderApi.MakeupServiceOrder>>('/wedding/makeup-service-order/page', { params });
}

/** 查询化妆服务订单详情 */
export function getMakeupServiceOrder(id: number) {
  return requestClient.get<MakeupServiceOrderApi.MakeupServiceOrder>(`/wedding/makeup-service-order/get?id=${id}`);
}

/** 新增化妆服务订单 */
export function createMakeupServiceOrder(data: MakeupServiceOrderApi.MakeupServiceOrder) {
  return requestClient.post('/wedding/makeup-service-order/create', data);
}

/** 修改化妆服务订单 */
export function updateMakeupServiceOrder(data: MakeupServiceOrderApi.MakeupServiceOrder) {
  return requestClient.put('/wedding/makeup-service-order/update', data);
}

/** 删除化妆服务订单 */
export function deleteMakeupServiceOrder(id: number) {
  return requestClient.delete(`/wedding/makeup-service-order/delete?id=${id}`);
}


/** 导出化妆服务订单 */
export function exportMakeupServiceOrder(params: any) {
  return requestClient.download('/wedding/makeup-service-order/export-excel', { params });
}

